<template>
  <div class="logoutreview">
    <el-table v-loading="loading" :data="tableData" border style="width: 100%">
      <el-table-column prop="rand" label="序号" align="center">
      </el-table-column>
      <el-table-column prop="phone" label="手机号" align="center">
      </el-table-column>
      <el-table-column prop="var" label="提现金额" align="center">
      </el-table-column>
      <el-table-column prop="type" label="类型" align="center">
      </el-table-column>
      <el-table-column prop="note" label="标注" align="center">
      </el-table-column>
      <el-table-column prop="alipayid" label="支付宝账号" align="center">
      </el-table-column>
      <el-table-column prop="noteTime" label="提交时间" align="center">
      </el-table-column>
      <el-table-column prop="status" label="状态" align="center">
      </el-table-column>
      <el-table-column
          align="center"
          fixed="right"
          label="操作"
      >
        <template slot-scope="scope">
          <el-button type="text" @click="pass(scope.row)" size="small"
                     v-show="scope.row.status==='待审核'">通过
          </el-button>

        </template>
      </el-table-column>


    </el-table>
    <el-dialog
        title="提示"
        :visible.sync="dialogPassVisible"
        width="30%"
    >
      <span>确认通过注销申请?</span>
      <span slot="footer" class="dialog-footer">
    <el-button @click="dialogPassVisible = false">取 消</el-button>
    <el-button type="primary" @click="PassSure">确 定</el-button>
  </span>
    </el-dialog>


  </div>
</template>
<script>
import {logoutreviews, logoutPass} from '@/api/api.js';

export default {
  data() {
    return {
      tableData: [],
      data: "",
      loading: false,
      dialogPassVisible: false,
      dialogUnpassVisible: false,
      unpassReason: ''
    }
  },
  created() {
    this.getData();
  },
  methods: {
    getData(params) {
      logoutreviews(params)
          .then(res => {
            console.log(res.data);
            this.tableData = res.data.data
          })
    },
    pass(params) {
      this.dialogPassVisible = true;
      this.data = params;
    },

    PassSure() {
      this.dialogPassVisible = false;
      this.loading = true;
      logoutPass(this.data)
          .then(res => {
            console.log(res.data)
            this.loading = false;
            this.tableData = res.data.data
          })
    }

  }
}
</script>
<style lang="scss" scoped>
.logoutreview {

  margin-top: 20px;
}
</style>